package com.teacher.pojo.enums;

/**
 * @Author: zfm
 * @Date: 2021/8/3 11:41
 */
public enum FlowType {
    /**
     * 流程类型
     */
    MORAL_EDUCATION(10, "德育素质"), JOB(20, "学生干部任职"),
    GOOD_THINGS(30, "好人好事"), PUBLIC_WELFARE_ACTIVITIES(40, "公益活动"),
    CERTIFICATE(50, "证书申请"), INNOVATIVE_UNDERTAKING(60, "创新创业认定"),
    COURSE_CONTESTS(70, "学科竞赛"),
    CULTURAL_ACTIVITIES_REWARD(80, "文艺活动"),
    CULTURAL_TRANSMISSION(90, "文化传播");
    private String type;
    private Integer code;

    FlowType(Integer code, String type) {
        this.type = type;
        this.code = code;
    }

    public static Integer getCodeByName(String name) {
        for (FlowType flowType : FlowType.values()) {
            if (flowType.type.equals(name)) {
                return flowType.code;
            }
        }
        return 0;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
